package com.rc.evcharger.common.enums;

/**
 * Create by Yang on 2021/9/28
 */
public enum PileVersionEnum {

    //新亚协议
    XINYA_VERSION_232("232", "XINYA"),
    XINYA_VERSION_260("260", "XINYA"),
    XINYA_VERSION_261("261", "XINYA"),
    XINYA_VERSION_262("262", "XINYA"),
    XINYA_VERSION_263("263", "XINYA"),
    XINYA_VERSION_264("264", "XINYA"),
    XINYA_VERSION_265("265", "XINYA"),
    XINYA_VERSION_266("266", "XINYA"),
    XINYA_VERSION_267("267", "XINYA"),
    XINYA_VERSION_268("268", "XINYA"),
    XINYA_VERSION_269("269", "XINYA"),
    XINYA_VERSION_270("270", "XINYA"),
    XINYA_VERSION_271("271", "XINYA"),
    XINYA_VERSION_272("272", "XINYA"),
    XINYA_VERSION_273("273", "XINYA"),
    XINYA_VERSION_274("274", "XINYA"),
    XINYA_VERSION_275("275", "XINYA"),
    XINYA_VERSION_276("276", "XINYA"),
    XINYA_VERSION_277("277", "XINYA"),
    XINYA_VERSION_278("278", "XINYA"),
    XINYA_VERSION_279("279", "XINYA"),
    XINYA_VERSION_280("280", "XINYA"),

    //派诺协议
    PAINUO_VERSION_101("101", "PAINUO"),
    PAINUO_VERSION_102("102", "PAINUO"),
    PAINUO_VERSION_103("103", "PAINUO"),
    PAINUO_VERSION_104("104", "PAINUO"),
    PAINUO_VERSION_105("105", "PAINUO"),
    PAINUO_VERSION_106("106", "PAINUO"),
    PAINUO_VERSION_107("107", "PAINUO"),
    PAINUO_VERSION_108("108", "PAINUO"),
    PAINUO_VERSION_109("109", "PAINUO"),

    //鸿嘉利协议
    HONGJIALI_VERSION_311("311", "HONGJIALI");

    private String code;
    private String msg;

    PileVersionEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 是否符合离网不停充要求
     *
     * @param code
     * @return
     */
    public static boolean getPileVersionEnumResult(String version) {
        Class<PileVersionEnum> enumClass = PileVersionEnum.class;
        for (PileVersionEnum elecPileStopReasonEnum : enumClass.getEnumConstants()) {
            if (version.equals(elecPileStopReasonEnum.getCode())) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        //boolean pileVersionEnumResult = PileVersionEnum.getPileVersionEnumResult("280");
        //System.out.println(pileVersionEnumResult);
    }
}
